--
-- PostgreSQL database dump
--

-- Started on 2009-11-10 07:34:38

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 372 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

--
-- TOC entry 361 (class 1247 OID 16547)
-- Dependencies: 3 1589
-- Name: tablefunc_crosstab_2; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE tablefunc_crosstab_2 AS (
	row_name text,
	category_1 text,
	category_2 text
);


ALTER TYPE public.tablefunc_crosstab_2 OWNER TO postgres;

--
-- TOC entry 363 (class 1247 OID 16550)
-- Dependencies: 3 1590
-- Name: tablefunc_crosstab_3; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE tablefunc_crosstab_3 AS (
	row_name text,
	category_1 text,
	category_2 text,
	category_3 text
);


ALTER TYPE public.tablefunc_crosstab_3 OWNER TO postgres;

--
-- TOC entry 365 (class 1247 OID 16553)
-- Dependencies: 3 1591
-- Name: tablefunc_crosstab_4; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE tablefunc_crosstab_4 AS (
	row_name text,
	category_1 text,
	category_2 text,
	category_3 text,
	category_4 text
);


ALTER TYPE public.tablefunc_crosstab_4 OWNER TO postgres;

--
-- TOC entry 26 (class 1255 OID 16559)
-- Dependencies: 3
-- Name: connectby(text, text, text, text, integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, integer, text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text';


ALTER FUNCTION public.connectby(text, text, text, text, integer, text) OWNER TO postgres;

--
-- TOC entry 27 (class 1255 OID 16560)
-- Dependencies: 3
-- Name: connectby(text, text, text, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, integer) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text';


ALTER FUNCTION public.connectby(text, text, text, text, integer) OWNER TO postgres;

--
-- TOC entry 28 (class 1255 OID 16561)
-- Dependencies: 3
-- Name: connectby(text, text, text, text, text, integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, text, integer, text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text_serial';


ALTER FUNCTION public.connectby(text, text, text, text, text, integer, text) OWNER TO postgres;

--
-- TOC entry 29 (class 1255 OID 16562)
-- Dependencies: 3
-- Name: connectby(text, text, text, text, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, text, integer) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text_serial';


ALTER FUNCTION public.connectby(text, text, text, text, text, integer) OWNER TO postgres;

--
-- TOC entry 20 (class 1255 OID 16544)
-- Dependencies: 3
-- Name: crosstab(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab(text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab(text) OWNER TO postgres;

--
-- TOC entry 24 (class 1255 OID 16557)
-- Dependencies: 3
-- Name: crosstab(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab(text, integer) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab(text, integer) OWNER TO postgres;

--
-- TOC entry 25 (class 1255 OID 16558)
-- Dependencies: 3
-- Name: crosstab(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab(text, text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab_hash';


ALTER FUNCTION public.crosstab(text, text) OWNER TO postgres;

--
-- TOC entry 21 (class 1255 OID 16554)
-- Dependencies: 3 361
-- Name: crosstab2(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab2(text) RETURNS SETOF tablefunc_crosstab_2
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab2(text) OWNER TO postgres;

--
-- TOC entry 22 (class 1255 OID 16555)
-- Dependencies: 363 3
-- Name: crosstab3(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab3(text) RETURNS SETOF tablefunc_crosstab_3
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab3(text) OWNER TO postgres;

--
-- TOC entry 23 (class 1255 OID 16556)
-- Dependencies: 3 365
-- Name: crosstab4(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab4(text) RETURNS SETOF tablefunc_crosstab_4
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab4(text) OWNER TO postgres;

--
-- TOC entry 30 (class 1255 OID 24621)
-- Dependencies: 3
-- Name: get_data(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION get_data() RETURNS TABLE(id integer, description character varying)
    LANGUAGE sql
    AS $$
 SELECT * from environments where description = 'Stage';
$$;


ALTER FUNCTION public.get_data() OWNER TO postgres;

--
-- TOC entry 19 (class 1255 OID 16543)
-- Dependencies: 3
-- Name: normal_rand(integer, double precision, double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION normal_rand(integer, double precision, double precision) RETURNS SETOF double precision
    LANGUAGE c STRICT
    AS '$libdir/tablefunc', 'normal_rand';


ALTER FUNCTION public.normal_rand(integer, double precision, double precision) OWNER TO postgres;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1570 (class 1259 OID 16439)
-- Dependencies: 1878 3
-- Name: attachments; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE attachments (
    id integer NOT NULL,
    caseid integer NOT NULL,
    cilename character varying(100),
    dateuploaded date DEFAULT ('now'::text)::date,
    uploadedby integer,
    dateupdated date,
    updatedby integer
);


ALTER TABLE public.attachments OWNER TO postgres;

--
-- TOC entry 1569 (class 1259 OID 16437)
-- Dependencies: 3 1570
-- Name: attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE attachments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.attachments_id_seq OWNER TO postgres;

--
-- TOC entry 1946 (class 0 OID 0)
-- Dependencies: 1569
-- Name: attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE attachments_id_seq OWNED BY attachments.id;


--
-- TOC entry 1947 (class 0 OID 0)
-- Dependencies: 1569
-- Name: attachments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('attachments_id_seq', 1, false);


--
-- TOC entry 1574 (class 1259 OID 16456)
-- Dependencies: 3
-- Name: caseenvirons; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE caseenvirons (
    id integer NOT NULL,
    caseid integer,
    environmentid integer
);


ALTER TABLE public.caseenvirons OWNER TO postgres;

--
-- TOC entry 1573 (class 1259 OID 16454)
-- Dependencies: 3 1574
-- Name: caseenvirons_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE caseenvirons_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.caseenvirons_id_seq OWNER TO postgres;

--
-- TOC entry 1948 (class 0 OID 0)
-- Dependencies: 1573
-- Name: caseenvirons_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE caseenvirons_id_seq OWNED BY caseenvirons.id;


--
-- TOC entry 1949 (class 0 OID 0)
-- Dependencies: 1573
-- Name: caseenvirons_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('caseenvirons_id_seq', 36, true);


--
-- TOC entry 1576 (class 1259 OID 16464)
-- Dependencies: 1882 1883 3
-- Name: casesuites; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE casesuites (
    id integer NOT NULL,
    parentplanid integer,
    nodetype integer,
    path text,
    description character varying(100),
    creatorid integer,
    lastmodifiedbyid integer,
    datecreated date DEFAULT ('now'::text)::date,
    datemodified date,
    category character varying(100),
    priority integer DEFAULT 2,
    steps text
);


ALTER TABLE public.casesuites OWNER TO postgres;

--
-- TOC entry 1575 (class 1259 OID 16462)
-- Dependencies: 1576 3
-- Name: casesuites_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE casesuites_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.casesuites_id_seq OWNER TO postgres;

--
-- TOC entry 1950 (class 0 OID 0)
-- Dependencies: 1575
-- Name: casesuites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE casesuites_id_seq OWNED BY casesuites.id;


--
-- TOC entry 1951 (class 0 OID 0)
-- Dependencies: 1575
-- Name: casesuites_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('casesuites_id_seq', 14, true);


--
-- TOC entry 1572 (class 1259 OID 16448)
-- Dependencies: 3
-- Name: casetesters; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE casetesters (
    id integer NOT NULL,
    caseid integer NOT NULL,
    testerid integer NOT NULL
);


ALTER TABLE public.casetesters OWNER TO postgres;

--
-- TOC entry 1571 (class 1259 OID 16446)
-- Dependencies: 3 1572
-- Name: casetesters_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE casetesters_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.casetesters_id_seq OWNER TO postgres;

--
-- TOC entry 1952 (class 0 OID 0)
-- Dependencies: 1571
-- Name: casetesters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE casetesters_id_seq OWNED BY casetesters.id;


--
-- TOC entry 1953 (class 0 OID 0)
-- Dependencies: 1571
-- Name: casetesters_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('casetesters_id_seq', 2, true);


--
-- TOC entry 1560 (class 1259 OID 16399)
-- Dependencies: 3
-- Name: environments; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE environments (
    id integer NOT NULL,
    description character varying(100) NOT NULL
);


ALTER TABLE public.environments OWNER TO postgres;

--
-- TOC entry 1559 (class 1259 OID 16397)
-- Dependencies: 3 1560
-- Name: environments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE environments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.environments_id_seq OWNER TO postgres;

--
-- TOC entry 1954 (class 0 OID 0)
-- Dependencies: 1559
-- Name: environments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE environments_id_seq OWNED BY environments.id;


--
-- TOC entry 1955 (class 0 OID 0)
-- Dependencies: 1559
-- Name: environments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('environments_id_seq', 3, true);


--
-- TOC entry 1562 (class 1259 OID 16407)
-- Dependencies: 3
-- Name: plans; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE plans (
    id integer NOT NULL,
    creatorid integer NOT NULL,
    releaseid integer NOT NULL,
    referencenumber character varying(10) NOT NULL,
    description character varying(100) NOT NULL
);


ALTER TABLE public.plans OWNER TO postgres;

--
-- TOC entry 1561 (class 1259 OID 16405)
-- Dependencies: 3 1562
-- Name: plans_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE plans_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.plans_id_seq OWNER TO postgres;

--
-- TOC entry 1956 (class 0 OID 0)
-- Dependencies: 1561
-- Name: plans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE plans_id_seq OWNED BY plans.id;


--
-- TOC entry 1957 (class 0 OID 0)
-- Dependencies: 1561
-- Name: plans_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('plans_id_seq', 2, true);


--
-- TOC entry 1564 (class 1259 OID 16415)
-- Dependencies: 3
-- Name: releases; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE releases (
    id integer NOT NULL,
    description character varying(100) NOT NULL,
    expirationdate date NOT NULL,
    active character varying(5)
);


ALTER TABLE public.releases OWNER TO postgres;

--
-- TOC entry 1563 (class 1259 OID 16413)
-- Dependencies: 1564 3
-- Name: releases_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE releases_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.releases_id_seq OWNER TO postgres;

--
-- TOC entry 1958 (class 0 OID 0)
-- Dependencies: 1563
-- Name: releases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE releases_id_seq OWNED BY releases.id;


--
-- TOC entry 1959 (class 0 OID 0)
-- Dependencies: 1563
-- Name: releases_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('releases_id_seq', 1, true);


--
-- TOC entry 1584 (class 1259 OID 16505)
-- Dependencies: 3
-- Name: repcategories; Type: TABLE; Schema: public; Owner: speedtestadmin; Tablespace: 
--

CREATE TABLE repcategories (
    id integer NOT NULL,
    description character varying(40)
);


ALTER TABLE public.repcategories OWNER TO speedtestadmin;

--
-- TOC entry 1583 (class 1259 OID 16503)
-- Dependencies: 1584 3
-- Name: reportcategories_id_seq; Type: SEQUENCE; Schema: public; Owner: speedtestadmin
--

CREATE SEQUENCE reportcategories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reportcategories_id_seq OWNER TO speedtestadmin;

--
-- TOC entry 1960 (class 0 OID 0)
-- Dependencies: 1583
-- Name: reportcategories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: speedtestadmin
--

ALTER SEQUENCE reportcategories_id_seq OWNED BY repcategories.id;


--
-- TOC entry 1961 (class 0 OID 0)
-- Dependencies: 1583
-- Name: reportcategories_id_seq; Type: SEQUENCE SET; Schema: public; Owner: speedtestadmin
--

SELECT pg_catalog.setval('reportcategories_id_seq', 2, true);


--
-- TOC entry 1582 (class 1259 OID 16497)
-- Dependencies: 3
-- Name: reports; Type: TABLE; Schema: public; Owner: speedtestadmin; Tablespace: 
--

CREATE TABLE reports (
    id integer NOT NULL,
    reportname character varying(40),
    categoryid integer,
    header character varying(100)
);


ALTER TABLE public.reports OWNER TO speedtestadmin;

--
-- TOC entry 1581 (class 1259 OID 16495)
-- Dependencies: 3 1582
-- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: speedtestadmin
--

CREATE SEQUENCE reports_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reports_id_seq OWNER TO speedtestadmin;

--
-- TOC entry 1962 (class 0 OID 0)
-- Dependencies: 1581
-- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: speedtestadmin
--

ALTER SEQUENCE reports_id_seq OWNED BY reports.id;


--
-- TOC entry 1963 (class 0 OID 0)
-- Dependencies: 1581
-- Name: reports_id_seq; Type: SEQUENCE SET; Schema: public; Owner: speedtestadmin
--

SELECT pg_catalog.setval('reports_id_seq', 4, true);


--
-- TOC entry 1586 (class 1259 OID 16513)
-- Dependencies: 3
-- Name: repsections; Type: TABLE; Schema: public; Owner: speedtestadmin; Tablespace: 
--

CREATE TABLE repsections (
    id integer NOT NULL,
    sectionsql text,
    header character varying(100),
    sectiontype character varying(40),
    reportid integer
);


ALTER TABLE public.repsections OWNER TO speedtestadmin;

--
-- TOC entry 1585 (class 1259 OID 16511)
-- Dependencies: 3 1586
-- Name: repsections_ID_seq; Type: SEQUENCE; Schema: public; Owner: speedtestadmin
--

CREATE SEQUENCE "repsections_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public."repsections_ID_seq" OWNER TO speedtestadmin;

--
-- TOC entry 1964 (class 0 OID 0)
-- Dependencies: 1585
-- Name: repsections_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: speedtestadmin
--

ALTER SEQUENCE "repsections_ID_seq" OWNED BY repsections.id;


--
-- TOC entry 1965 (class 0 OID 0)
-- Dependencies: 1585
-- Name: repsections_ID_seq; Type: SEQUENCE SET; Schema: public; Owner: speedtestadmin
--

SELECT pg_catalog.setval('"repsections_ID_seq"', 2, true);


--
-- TOC entry 1588 (class 1259 OID 16526)
-- Dependencies: 1890 1891 3
-- Name: repselections; Type: TABLE; Schema: public; Owner: speedtestadmin; Tablespace: 
--

CREATE TABLE repselections (
    id integer NOT NULL,
    selectionsql text,
    selectiontype character varying(30),
    valuemember character varying(40),
    displaymember character varying(40),
    parametername character varying(40),
    reportid integer,
    label character varying(20),
    defaultvalue character varying(40),
    isrequired boolean DEFAULT true,
    sequence integer DEFAULT 1
);


ALTER TABLE public.repselections OWNER TO speedtestadmin;

--
-- TOC entry 1587 (class 1259 OID 16524)
-- Dependencies: 3 1588
-- Name: repselections_id_seq; Type: SEQUENCE; Schema: public; Owner: speedtestadmin
--

CREATE SEQUENCE repselections_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.repselections_id_seq OWNER TO speedtestadmin;

--
-- TOC entry 1966 (class 0 OID 0)
-- Dependencies: 1587
-- Name: repselections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: speedtestadmin
--

ALTER SEQUENCE repselections_id_seq OWNED BY repselections.id;


--
-- TOC entry 1967 (class 0 OID 0)
-- Dependencies: 1587
-- Name: repselections_id_seq; Type: SEQUENCE SET; Schema: public; Owner: speedtestadmin
--

SELECT pg_catalog.setval('repselections_id_seq', 1, true);


--
-- TOC entry 1580 (class 1259 OID 16485)
-- Dependencies: 3
-- Name: results; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE results (
    id integer NOT NULL,
    planid integer,
    caseid integer,
    environmentid integer,
    result character varying(100),
    referencenumber character varying(100),
    notes text,
    executiondate date,
    userid integer,
    active character varying(5)
);


ALTER TABLE public.results OWNER TO postgres;

--
-- TOC entry 1579 (class 1259 OID 16483)
-- Dependencies: 3 1580
-- Name: results_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE results_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.results_id_seq OWNER TO postgres;

--
-- TOC entry 1968 (class 0 OID 0)
-- Dependencies: 1579
-- Name: results_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE results_id_seq OWNED BY results.id;


--
-- TOC entry 1969 (class 0 OID 0)
-- Dependencies: 1579
-- Name: results_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('results_id_seq', 20, true);


--
-- TOC entry 1593 (class 1259 OID 16565)
-- Dependencies: 3
-- Name: resulttext; Type: TABLE; Schema: public; Owner: speedtestadmin; Tablespace: 
--

CREATE TABLE resulttext (
    id integer NOT NULL,
    result character varying(20),
    textmatch character varying(20)
);


ALTER TABLE public.resulttext OWNER TO speedtestadmin;

--
-- TOC entry 1592 (class 1259 OID 16563)
-- Dependencies: 3 1593
-- Name: resulttext_id_seq; Type: SEQUENCE; Schema: public; Owner: speedtestadmin
--

CREATE SEQUENCE resulttext_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.resulttext_id_seq OWNER TO speedtestadmin;

--
-- TOC entry 1970 (class 0 OID 0)
-- Dependencies: 1592
-- Name: resulttext_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: speedtestadmin
--

ALTER SEQUENCE resulttext_id_seq OWNED BY resulttext.id;


--
-- TOC entry 1971 (class 0 OID 0)
-- Dependencies: 1592
-- Name: resulttext_id_seq; Type: SEQUENCE SET; Schema: public; Owner: speedtestadmin
--

SELECT pg_catalog.setval('resulttext_id_seq', 1, false);


--
-- TOC entry 1568 (class 1259 OID 16431)
-- Dependencies: 1876 3
-- Name: roles; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE roles (
    id integer NOT NULL,
    description character varying(100),
    releasepermissions character varying(10),
    environpermissions character varying(10),
    planpermissions character varying(10),
    userpermissions character varying(10),
    rolepermissions character varying(10),
    serveroptpermissions character varying(10),
    iswebonly boolean DEFAULT true
);


ALTER TABLE public.roles OWNER TO postgres;

--
-- TOC entry 1567 (class 1259 OID 16429)
-- Dependencies: 1568 3
-- Name: roles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE roles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.roles_id_seq OWNER TO postgres;

--
-- TOC entry 1972 (class 0 OID 0)
-- Dependencies: 1567
-- Name: roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE roles_id_seq OWNED BY roles.id;


--
-- TOC entry 1973 (class 0 OID 0)
-- Dependencies: 1567
-- Name: roles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('roles_id_seq', 5, true);


--
-- TOC entry 1578 (class 1259 OID 16477)
-- Dependencies: 3
-- Name: serveroptions; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE serveroptions (
    id integer NOT NULL,
    path character varying(255),
    autoactivateusers character varying(5),
    defaultrole integer
);


ALTER TABLE public.serveroptions OWNER TO postgres;

--
-- TOC entry 1577 (class 1259 OID 16475)
-- Dependencies: 3 1578
-- Name: serveroptions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE serveroptions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.serveroptions_id_seq OWNER TO postgres;

--
-- TOC entry 1974 (class 0 OID 0)
-- Dependencies: 1577
-- Name: serveroptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE serveroptions_id_seq OWNED BY serveroptions.id;


--
-- TOC entry 1975 (class 0 OID 0)
-- Dependencies: 1577
-- Name: serveroptions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('serveroptions_id_seq', 1, false);


--
-- TOC entry 1566 (class 1259 OID 16423)
-- Dependencies: 3
-- Name: users; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE users (
    id integer NOT NULL,
    name character varying(100) NOT NULL,
    username character varying(100) NOT NULL,
    password character varying(100) NOT NULL,
    roleid integer NOT NULL,
    active character varying(5),
    email character varying(100)
);


ALTER TABLE public.users OWNER TO postgres;

--
-- TOC entry 1565 (class 1259 OID 16421)
-- Dependencies: 1566 3
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.users_id_seq OWNER TO postgres;

--
-- TOC entry 1976 (class 0 OID 0)
-- Dependencies: 1565
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE users_id_seq OWNED BY users.id;


--
-- TOC entry 1977 (class 0 OID 0)
-- Dependencies: 1565
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('users_id_seq', 4, true);


--
-- TOC entry 1877 (class 2604 OID 16442)
-- Dependencies: 1570 1569 1570
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE attachments ALTER COLUMN id SET DEFAULT nextval('attachments_id_seq'::regclass);


--
-- TOC entry 1880 (class 2604 OID 16459)
-- Dependencies: 1574 1573 1574
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE caseenvirons ALTER COLUMN id SET DEFAULT nextval('caseenvirons_id_seq'::regclass);


--
-- TOC entry 1881 (class 2604 OID 16467)
-- Dependencies: 1575 1576 1576
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE casesuites ALTER COLUMN id SET DEFAULT nextval('casesuites_id_seq'::regclass);


--
-- TOC entry 1879 (class 2604 OID 16451)
-- Dependencies: 1572 1571 1572
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE casetesters ALTER COLUMN id SET DEFAULT nextval('casetesters_id_seq'::regclass);


--
-- TOC entry 1871 (class 2604 OID 16402)
-- Dependencies: 1560 1559 1560
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE environments ALTER COLUMN id SET DEFAULT nextval('environments_id_seq'::regclass);


--
-- TOC entry 1872 (class 2604 OID 16410)
-- Dependencies: 1562 1561 1562
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE plans ALTER COLUMN id SET DEFAULT nextval('plans_id_seq'::regclass);


--
-- TOC entry 1873 (class 2604 OID 16418)
-- Dependencies: 1564 1563 1564
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE releases ALTER COLUMN id SET DEFAULT nextval('releases_id_seq'::regclass);


--
-- TOC entry 1887 (class 2604 OID 16508)
-- Dependencies: 1584 1583 1584
-- Name: id; Type: DEFAULT; Schema: public; Owner: speedtestadmin
--

ALTER TABLE repcategories ALTER COLUMN id SET DEFAULT nextval('reportcategories_id_seq'::regclass);


--
-- TOC entry 1886 (class 2604 OID 16500)
-- Dependencies: 1582 1581 1582
-- Name: id; Type: DEFAULT; Schema: public; Owner: speedtestadmin
--

ALTER TABLE reports ALTER COLUMN id SET DEFAULT nextval('reports_id_seq'::regclass);


--
-- TOC entry 1888 (class 2604 OID 16516)
-- Dependencies: 1586 1585 1586
-- Name: id; Type: DEFAULT; Schema: public; Owner: speedtestadmin
--

ALTER TABLE repsections ALTER COLUMN id SET DEFAULT nextval('"repsections_ID_seq"'::regclass);


--
-- TOC entry 1889 (class 2604 OID 16529)
-- Dependencies: 1587 1588 1588
-- Name: id; Type: DEFAULT; Schema: public; Owner: speedtestadmin
--

ALTER TABLE repselections ALTER COLUMN id SET DEFAULT nextval('repselections_id_seq'::regclass);


--
-- TOC entry 1885 (class 2604 OID 16488)
-- Dependencies: 1580 1579 1580
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE results ALTER COLUMN id SET DEFAULT nextval('results_id_seq'::regclass);


--
-- TOC entry 1892 (class 2604 OID 16568)
-- Dependencies: 1593 1592 1593
-- Name: id; Type: DEFAULT; Schema: public; Owner: speedtestadmin
--

ALTER TABLE resulttext ALTER COLUMN id SET DEFAULT nextval('resulttext_id_seq'::regclass);


--
-- TOC entry 1875 (class 2604 OID 16434)
-- Dependencies: 1567 1568 1568
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE roles ALTER COLUMN id SET DEFAULT nextval('roles_id_seq'::regclass);


--
-- TOC entry 1884 (class 2604 OID 16480)
-- Dependencies: 1577 1578 1578
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE serveroptions ALTER COLUMN id SET DEFAULT nextval('serveroptions_id_seq'::regclass);


--
-- TOC entry 1874 (class 2604 OID 16426)
-- Dependencies: 1565 1566 1566
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);


--
-- TOC entry 1930 (class 0 OID 16439)
-- Dependencies: 1570
-- Data for Name: attachments; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1932 (class 0 OID 16456)
-- Dependencies: 1574
-- Data for Name: caseenvirons; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (1, 47, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (2, 47, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (3, 47, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (4, 48, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (5, 48, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (6, 48, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (7, 49, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (8, 49, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (9, 49, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (10, 1, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (11, 1, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (12, 1, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (13, 50, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (14, 50, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (15, 50, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (16, 7, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (17, 7, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (18, 7, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (19, 8, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (20, 8, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (21, 8, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (22, 9, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (23, 9, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (24, 9, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (25, 10, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (26, 10, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (27, 10, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (28, 11, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (29, 11, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (30, 11, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (31, 12, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (32, 12, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (33, 12, 3);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (34, 14, 1);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (35, 14, 2);
INSERT INTO caseenvirons (id, caseid, environmentid) VALUES (36, 14, 3);


--
-- TOC entry 1933 (class 0 OID 16464)
-- Dependencies: 1576
-- Data for Name: casesuites; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (47, 1, 2, '001.001.001', 'case ', 1, 1, '2009-10-28', '2009-11-06', '', 2, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (48, 1, 2, '002.001.001', 'case 1', 1, 1, '2009-10-28', '2009-11-06', '', 1, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (49, 1, 2, '003.001.001', 'case 2', 1, 1, '2009-10-28', '2009-11-06', '', 3, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (1, 1, 2, '004.001.002', 'case 4', 1, 1, '2009-11-06', '2009-11-06', '1234', 0, '<NewDataSet>
  <Steps>
    <Step>test</Step>
    <ExpectedResult>test</ExpectedResult>
  </Steps>
</NewDataSet>');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (50, 1, 2, '004.001.001', 'case 3', 1, 1, '2009-10-28', '2009-11-07', '', 4, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (2, 1, 2, '004.001.003', 'test unassigned', 1, NULL, '2009-11-07', NULL, '', 2, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (4, 2, 1, '002', 'Suite 4', 1, NULL, '2009-11-07', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (5, 2, 1, '003', 'Suite 5', 1, NULL, '2009-11-07', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (6, 2, 1, '004', 'Suite 6', 1, NULL, '2009-11-07', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (3, 2, 1, '001', 'Suite 3.5', 1, NULL, '2009-11-07', NULL, NULL, 2, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (7, 2, 2, '001.001', 'Test', 1, NULL, '2009-11-07', NULL, '', 2, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (8, 2, 2, '002.001', 'Test', 1, NULL, '2009-11-07', NULL, 'n', 2, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (9, 2, 2, '003.001', 'Test', 1, NULL, '2009-11-07', NULL, 'asd', 3, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (10, 2, 2, '004.001', 'test', 1, NULL, '2009-11-07', NULL, '41234', 3, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (11, 2, 2, '001.002', 'asdf', 1, NULL, '2009-11-07', NULL, 'safsdf', 1, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (12, 2, 2, '002.002', 'dfghjs', 1, NULL, '2009-11-07', NULL, 'dfhjsdf', 1, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (13, 2, 2, '003.002', 'bvxvxb', 1, NULL, '2009-11-07', NULL, 'xvbxvb', 0, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (14, 2, 2, '004.002', 'vbnccvbn', 1, NULL, '2009-11-07', NULL, 'vcbnc', 0, '');
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (39, 1, 1, '001', 'Suite', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (40, 1, 1, '002', 'Suite 1', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (41, 1, 1, '003', 'Suite 2', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (42, 1, 1, '004', 'Suite 3', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (43, 1, 1, '001.001', 'Sub suite ', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (44, 1, 1, '002.001', 'Sub suite 1', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (45, 1, 1, '003.001', 'Sub suite 2', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);
INSERT INTO casesuites (id, parentplanid, nodetype, path, description, creatorid, lastmodifiedbyid, datecreated, datemodified, category, priority, steps) VALUES (46, 1, 1, '004.001', 'Sub suite 3', 1, NULL, '2009-10-28', NULL, NULL, 2, NULL);


--
-- TOC entry 1931 (class 0 OID 16448)
-- Dependencies: 1572
-- Data for Name: casetesters; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO casetesters (id, caseid, testerid) VALUES (1, 1, 1);
INSERT INTO casetesters (id, caseid, testerid) VALUES (2, 9, 1);


--
-- TOC entry 1925 (class 0 OID 16399)
-- Dependencies: 1560
-- Data for Name: environments; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO environments (id, description) VALUES (1, 'Test');
INSERT INTO environments (id, description) VALUES (2, 'Stage');
INSERT INTO environments (id, description) VALUES (3, 'Production');


--
-- TOC entry 1926 (class 0 OID 16407)
-- Dependencies: 1562
-- Data for Name: plans; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO plans (id, creatorid, releaseid, referencenumber, description) VALUES (1, 1, 1, '12345', 'Test Plan');
INSERT INTO plans (id, creatorid, releaseid, referencenumber, description) VALUES (2, 1, 1, '54321', 'Test Plan 2');


--
-- TOC entry 1927 (class 0 OID 16415)
-- Dependencies: 1564
-- Data for Name: releases; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO releases (id, description, expirationdate, active) VALUES (1, 'Library', '2100-10-26', 'TRUE');


--
-- TOC entry 1937 (class 0 OID 16505)
-- Dependencies: 1584
-- Data for Name: repcategories; Type: TABLE DATA; Schema: public; Owner: speedtestadmin
--

INSERT INTO repcategories (id, description) VALUES (1, 'Release');
INSERT INTO repcategories (id, description) VALUES (2, 'Plan');


--
-- TOC entry 1936 (class 0 OID 16497)
-- Dependencies: 1582
-- Data for Name: reports; Type: TABLE DATA; Schema: public; Owner: speedtestadmin
--

INSERT INTO reports (id, reportname, categoryid, header) VALUES (1, 'Detail', 1, 'Release Detail');
INSERT INTO reports (id, reportname, categoryid, header) VALUES (2, 'Summary', 1, 'Release Summary');
INSERT INTO reports (id, reportname, categoryid, header) VALUES (3, 'Detail', 2, 'Plan Detail');
INSERT INTO reports (id, reportname, categoryid, header) VALUES (4, 'Summary', 2, 'Plan Summary');


--
-- TOC entry 1938 (class 0 OID 16513)
-- Dependencies: 1586
-- Data for Name: repsections; Type: TABLE DATA; Schema: public; Owner: speedtestadmin
--

INSERT INTO repsections (id, sectionsql, header, sectiontype, reportid) VALUES (1, 'Select Environment, Total, coalesce(notrun, 0) as Not_Run, coalesce(passed, 0) as Passed, coalesce(failed, 0) as Failed, coalesce(blocked, 0) as Blocked, coalesce(postponed, 0) as Postponed, coalesce(untestable, 0) as Untestable
from
(
	select * from
	(
		Select 
		environment as env, count(caseid) as total
		from plans
		join
		(
			select 
			casesuites.parentplanid as planid, casesuites.id as caseid, coalesce(environresults.environment, ''Unassigned'') as environment
			from casesuites
			left join
			(
				select caseenvirons.caseid, caseenvirons.environmentid, environments.description as environment from caseenvirons
				join environments on caseenvirons.environmentid = environments.id
			) AS environresults on casesuites.id = environresults.caseid
			where casesuites.nodetype = 2
		) as csresults on plans.id = csresults.planid
		where plans.releaseid = :RELEASEID
		group by environment
		order by environment asc
	) as cstotals
	join
	(
		select * from crosstab(''
			select
			environment, result, count(1) as count
			from
			(
				Select 
				caseid, environment, result
				from plans
				join
				(
					select 
					casesuites.parentplanid as planid, casesuites.id as caseid, coalesce(environresults.environment, ''''Unassigned'''') as environment, coalesce(environresults.result,''''NOT RUN'''') as result
					from casesuites
					left join
					(
						select caseenvirons.caseid, caseenvirons.environmentid, environments.description as environment, results.result as result from caseenvirons
						left join
						(
							select * from results where results.active = ''''TRUE''''
						) 
						as results on caseenvirons.caseid = results.caseid and caseenvirons.environmentid = results.environmentid
						join environments on caseenvirons.environmentid = environments.id
					) AS environresults on casesuites.id = environresults.caseid
					where casesuites.nodetype = 2
				) as csresults on plans.id = csresults.planid
				where plans.releaseid = '' || :RELEASEID || ''
			) as pcsresults
			group by result, environment
			order by environment, result''
			,
			''SELECT result FROM ResultText ORDER BY id ASC''
		) AS Report(environment text, NotRun int, Passed int, Failed int, Blocked int, Postponed int, Untestable int)
	) as ctabresults on ctabresults.environment = cstotals.env
) as outputreport', 'Test', 'TABLE', 1);
INSERT INTO repsections (id, sectionsql, header, sectiontype, reportid) VALUES (2, 'Select * from releases as all_releases where id = :RELEASEID; Select * from plans as all_plans where releaseid = :RELEASEID;', 'Test', 'MULTITABLE', 1);


--
-- TOC entry 1939 (class 0 OID 16526)
-- Dependencies: 1588
-- Data for Name: repselections; Type: TABLE DATA; Schema: public; Owner: speedtestadmin
--

INSERT INTO repselections (id, selectionsql, selectiontype, valuemember, displaymember, parametername, reportid, label, defaultvalue, isrequired, sequence) VALUES (1, 'SELECT id, description FROM releases', 'LIST', 'id', 'description', 'RELEASEID', 1, 'Release', '0', true, 1);


--
-- TOC entry 1935 (class 0 OID 16485)
-- Dependencies: 1580
-- Data for Name: results; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (1, 1, 47, 1, 'FAILED', '', '', '2009-10-29', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (2, 1, 48, 1, 'PASSED', '', '', '2009-10-29', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (3, 1, 49, 1, 'UNTESTABLE', '', '', '2009-10-29', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (4, 1, 50, 1, 'PASSED', '', '', '2009-10-29', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (5, 1, 47, 1, 'BLOCKED', '', '', '2009-11-06', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (9, 1, 47, 1, 'PASSED', '', '', '2009-11-06', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (6, 1, 48, 1, 'FAILED', '', '', '2009-11-06', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (10, 1, 48, 1, 'BLOCKED', '', '', '2009-11-06', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (7, 1, 49, 1, 'PASSED', '', '', '2009-11-06', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (11, 1, 49, 1, 'FAILED', '', '', '2009-11-06', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (8, 1, 50, 1, 'PASSED', '', '', '2009-11-06', 1, 'FALSE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (12, 1, 50, 1, 'UNTESTABLE', '', '', '2009-11-06', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (13, 1, 47, 2, 'FAILED', '', '', '2009-11-07', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (14, 1, 48, 2, 'PASSED', '', '', '2009-11-07', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (15, 1, 49, 2, 'FAILED', '', '', '2009-11-07', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (16, 1, 50, 2, 'BLOCKED', '', '', '2009-11-07', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (17, 1, 47, 3, 'BLOCKED', '', '', '2009-11-07', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (18, 1, 48, 3, 'FAILED', '', '', '2009-11-07', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (19, 1, 49, 3, 'PASSED', '', '', '2009-11-07', 1, 'TRUE');
INSERT INTO results (id, planid, caseid, environmentid, result, referencenumber, notes, executiondate, userid, active) VALUES (20, 1, 50, 3, 'BLOCKED', '', '', '2009-11-07', 1, 'TRUE');


--
-- TOC entry 1940 (class 0 OID 16565)
-- Dependencies: 1593
-- Data for Name: resulttext; Type: TABLE DATA; Schema: public; Owner: speedtestadmin
--

INSERT INTO resulttext (id, result, textmatch) VALUES (2, 'PASSED', 'PASSED');
INSERT INTO resulttext (id, result, textmatch) VALUES (3, 'FAILED', 'FAILED');
INSERT INTO resulttext (id, result, textmatch) VALUES (4, 'BLOCKED', 'BLOCKED');
INSERT INTO resulttext (id, result, textmatch) VALUES (5, 'POSTPONED', 'POSTPONED');
INSERT INTO resulttext (id, result, textmatch) VALUES (6, 'UNTESTABLE', 'UNTESTABLE');
INSERT INTO resulttext (id, result, textmatch) VALUES (1, 'NOT RUN', 'NOT RUN');


--
-- TOC entry 1929 (class 0 OID 16431)
-- Dependencies: 1568
-- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO roles (id, description, releasepermissions, environpermissions, planpermissions, userpermissions, rolepermissions, serveroptpermissions, iswebonly) VALUES (1, 'Admin', 'VECD', 'VECD', 'VECD', 'VECD', 'VECD', 'VECD', false);
INSERT INTO roles (id, description, releasepermissions, environpermissions, planpermissions, userpermissions, rolepermissions, serveroptpermissions, iswebonly) VALUES (2, 'Web Only', NULL, NULL, NULL, NULL, NULL, NULL, true);


--
-- TOC entry 1934 (class 0 OID 16477)
-- Dependencies: 1578
-- Data for Name: serveroptions; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1928 (class 0 OID 16423)
-- Dependencies: 1566
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO users (id, name, username, password, roleid, active, email) VALUES (2, 'test', 'test', 'test', 2, 'true', 'lanza.delrayo@gmail.com');
INSERT INTO users (id, name, username, password, roleid, active, email) VALUES (1, 'Guest', 'Guest', 'guest', 1, 'TRUE', NULL);
INSERT INTO users (id, name, username, password, roleid, active, email) VALUES (3, 'test', 'test', 'test', 2, 'true', 'test');
INSERT INTO users (id, name, username, password, roleid, active, email) VALUES (4, 'tester', 'tets', 'test', 2, 'true', 'test');


--
-- TOC entry 1904 (class 2606 OID 16445)
-- Dependencies: 1570 1570
-- Name: attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY attachments
    ADD CONSTRAINT attachments_pkey PRIMARY KEY (id);


--
-- TOC entry 1908 (class 2606 OID 16461)
-- Dependencies: 1574 1574
-- Name: caseenvirons_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY caseenvirons
    ADD CONSTRAINT caseenvirons_pkey PRIMARY KEY (id);


--
-- TOC entry 1910 (class 2606 OID 16474)
-- Dependencies: 1576 1576
-- Name: casesuites_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY casesuites
    ADD CONSTRAINT casesuites_pkey PRIMARY KEY (id);


--
-- TOC entry 1906 (class 2606 OID 16453)
-- Dependencies: 1572 1572
-- Name: casetesters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY casetesters
    ADD CONSTRAINT casetesters_pkey PRIMARY KEY (id);


--
-- TOC entry 1894 (class 2606 OID 16404)
-- Dependencies: 1560 1560
-- Name: environments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY environments
    ADD CONSTRAINT environments_pkey PRIMARY KEY (id);


--
-- TOC entry 1896 (class 2606 OID 16412)
-- Dependencies: 1562 1562
-- Name: plans_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY plans
    ADD CONSTRAINT plans_pkey PRIMARY KEY (id);


--
-- TOC entry 1898 (class 2606 OID 16420)
-- Dependencies: 1564 1564
-- Name: releases_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY releases
    ADD CONSTRAINT releases_pkey PRIMARY KEY (id);


--
-- TOC entry 1918 (class 2606 OID 16510)
-- Dependencies: 1584 1584
-- Name: reportcategories_pkey; Type: CONSTRAINT; Schema: public; Owner: speedtestadmin; Tablespace: 
--

ALTER TABLE ONLY repcategories
    ADD CONSTRAINT reportcategories_pkey PRIMARY KEY (id);


--
-- TOC entry 1916 (class 2606 OID 16502)
-- Dependencies: 1582 1582
-- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: speedtestadmin; Tablespace: 
--

ALTER TABLE ONLY reports
    ADD CONSTRAINT reports_pkey PRIMARY KEY (id);


--
-- TOC entry 1920 (class 2606 OID 16521)
-- Dependencies: 1586 1586
-- Name: repsections_pkey; Type: CONSTRAINT; Schema: public; Owner: speedtestadmin; Tablespace: 
--

ALTER TABLE ONLY repsections
    ADD CONSTRAINT repsections_pkey PRIMARY KEY (id);


--
-- TOC entry 1922 (class 2606 OID 16534)
-- Dependencies: 1588 1588
-- Name: repselections_pkey; Type: CONSTRAINT; Schema: public; Owner: speedtestadmin; Tablespace: 
--

ALTER TABLE ONLY repselections
    ADD CONSTRAINT repselections_pkey PRIMARY KEY (id);


--
-- TOC entry 1914 (class 2606 OID 16493)
-- Dependencies: 1580 1580
-- Name: results_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY results
    ADD CONSTRAINT results_pkey PRIMARY KEY (id);


--
-- TOC entry 1924 (class 2606 OID 16570)
-- Dependencies: 1593 1593
-- Name: resulttext_pkey; Type: CONSTRAINT; Schema: public; Owner: speedtestadmin; Tablespace: 
--

ALTER TABLE ONLY resulttext
    ADD CONSTRAINT resulttext_pkey PRIMARY KEY (id);


--
-- TOC entry 1902 (class 2606 OID 16436)
-- Dependencies: 1568 1568
-- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY roles
    ADD CONSTRAINT roles_pkey PRIMARY KEY (id);


--
-- TOC entry 1912 (class 2606 OID 16482)
-- Dependencies: 1578 1578
-- Name: serveroptions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY serveroptions
    ADD CONSTRAINT serveroptions_pkey PRIMARY KEY (id);


--
-- TOC entry 1900 (class 2606 OID 16428)
-- Dependencies: 1566 1566
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- TOC entry 1945 (class 0 OID 0)
-- Dependencies: 3
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2009-11-10 07:34:41

--
-- PostgreSQL database dump complete
--

